<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Пациент</title>
        <link type="text/css" rel="stylesheet" href="resources/css/default.css" />   
    </h:head>
    <h:body id="body">

        <table width="100%" border="1" >
            <tr>
                <td width="100%">
                    <table width="100%" border="1" align="center">
                        <td align="center">
                            <ui:include src="fortop.xhtml"/>
                        </td>
                    </table>
                </td>
            </tr>
            <tr>
                <table width="100%" border="1" align="top" height="600px" >
                    <td width="15%" valign="top">
                        <ui:include src="left.xhtml"/>
                    </td>
                    <td width="75%" align="center" valign="top">
                        <table width="100%" border="1" align="top">
                            <tr>
                                <td colspan="3" align="center">
                                    <p:panel id="panelfind">
                                        <h:form id="dfrom">
                                            <p:inputText size="70" id="findText" />
                                            <p:watermark for="findText" value="Поиск" />  
                                            <p:spacer width="2"/>  
                                            <p:commandButton id="find" ajax="false" style="text-align: center" value="Поиск" icon="ui-icon-search" iconPos="right" action="reg_pacient.xhtml" />
                                            <p:commandButton id="find1" ajax="false" style="text-align: center" value="Расширенный поиск" action="reg_pacient.xhtml"/> 
                                            <!--<p:spacer width="5"/>-->  
                                            <p:blockUI block="dfrom" trigger="find"  />
                                            <p:blockUI block="dfrom" trigger="find1"  />
                                        </h:form>
                                    </p:panel>
                                </td>

                            </tr>
                            <tr>
                                <td>
                                    <c:set  var="perTotalCount" value="${pacient.getPatOper(param.pname)}"/>
                                    #{perTotalCount.midName}
                                    #{perTotalCount.name}

                                </td>
                                <td>
                                    <p:dataGrid id="hhh" var="p" value="#{pacient.getP(param.pname)}" columns="1" paginator="false" emptyMessage="Нет зарегестрированных кроватей"    
                                                paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rows="5" 
                                                paginatorPosition="bottom" >
                                        <p:column >

                                            <h:outputText id="name" style="font-size: 16; color: green"  value="#{p.name} #{p.midName} #{p.lastName}"/><br/>
                                            <h:outputLabel for="birthday" value="Д.Рождения:"/><p:spacer width="5px"/>
                                            <h:outputText id="birthday" value="#{p.birthday}"><f:convertDateTime pattern="yyyy.MM.dd" />
                                            </h:outputText>

                                        </p:column>
                                    </p:dataGrid>       
                                </td>
                                <td>
                                    asdvfasd33333333333
                                </td>
                            </tr>
                            <tr>

                                <table width="100%" border="1" align="top">

                                    <tr>
                                        <td width="15%" valign="top">
                                            <h:form id="f1">
                                                <p:commandButton id="b1" style="margin-bottom: 5px;width: 100%;"  value="Первичный осмотр" action="#{pacient.setPF(true,false,false,false,false,false,false,false)}" update=":f2" ajax="true"/><br/>
                                                <p:commandButton id="b2" style="margin-bottom: 5px;width: 100%;" value="Дневник" action="#{pacient.setPF(false,true,false,false,false,false,false,false)}" update=":f2" ajax="true"/><br/>
                                                <p:commandButton id="b3" style="margin-bottom: 5px;width: 100%;" value="Лабораторные и дополнительные иследования" action="#{pacient.setPF(false,false,true,false,false,false,false,false)}" update=":f2" ajax="true"/><br/>
                                                <p:commandButton id="b4" style="margin-bottom: 5px;width: 100%;" value="План лечения" action="#{pacient.setPF(false,false,false,true,false,false,false,false)}" update=":f2" ajax="true"/><br/>
                                                <p:commandButton id="b5" style="margin-bottom: 5px;width: 100%;" value="План обследования" action="#{pacient.setPF(false,false,false,false,true,false,false,false)}" update=":f2" ajax="true"/><br/>
                                                <p:commandButton id="b6" style="margin-bottom: 5px;width: 100%;" value="Эпикрис" action="#{pacient.setPF(false,false,false,false,false,true,false,false)}" update=":f2" ajax="true"/><br/>
                                                <p:commandButton id="b7" style="margin-bottom: 5px;width: 100%;" value="История болезни" action="#{pacient.setPF(false,false,false,false,false,false,true,false)}" update=":f2" ajax="true" /><br/>
                                                <p:commandButton id="b8" style="margin-bottom: 5px;width: 100%;" value="Диагнозы" action="#{pacient.setPF(false,false,false,false,false,false,false,true)}" update=":f2" ajax="true" /><br/>
                                                
                                                <p:blockUI block="f1" trigger="b1"  />
                                                <p:blockUI block="f1" trigger="b2" />
                                                <p:blockUI block="f1" trigger="b3" />
                                                <p:blockUI block="f1" trigger="b4" />   
                                                <p:blockUI block="f1" trigger="b5" />
                                                <p:blockUI block="f1" trigger="b6" />
                                                <p:blockUI block="f1" trigger="b7" />
                                            </h:form>
                                        </td>
                                        <td colspan="3" width="100%" align="left" valign="top"> 

                                            <h:form id="f2">
                                                <p:outputPanel  id="panel"  rendered="#{pacient.pacientFirst}">  
                                                    <ui:include src="first_osmotr.xhtml" />
                                                </p:outputPanel>  
                                                <p:outputPanel  id="panelDnevnik"  rendered="#{pacient.dnevnik}">  
                                                    <ui:include src="dnevnik.xhtml" />
                                                </p:outputPanel>  
                                                <p:outputPanel  id="panelLaborotor"  rendered="#{pacient.laborotor}">  
                                                    <ui:include src="laborotor.xhtml" />
                                                </p:outputPanel>  
                                                <p:outputPanel  id="panelPlan"  rendered="#{pacient.plan}">  
                                                    <ui:include src="plan.xhtml" />
                                                </p:outputPanel>  
                                                <p:outputPanel  id="panelObselodovanie"  rendered="#{pacient.obsledovanie}">  
                                                    <ui:include src="obsledovanie.xhtml" />
                                                </p:outputPanel>  
                                                <p:outputPanel  id="panelEpikriz"  rendered="#{pacient.epikris}">  
                                                    <ui:include src="epikriz.xhtml" />
                                                </p:outputPanel>  
                                                <p:outputPanel  id="panelIstoriya"  rendered="#{pacient.istoriya}">  
                                                    <ui:include src="istoriya.xhtml" />
                                                </p:outputPanel>  
                                                <p:outputPanel  id="diag"  rendered="#{pacient.diagnos}">  
                                                    <ui:include src="diagnosi.xhtml" />
                                                </p:outputPanel> 
                                            </h:form>
                                        </td>
                                    </tr>
                                </table>
                            </tr>
                        </table>
                    </td>
                </table>
            </tr>
        </table> 
    </h:body>
</html>

